package test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static int n, m;
    public static int[] a;
    public static Map<Integer, Integer> map;
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        map = new HashMap<>();
        for(int i = 0; i<n; i++) {
            int a = in.nextInt();
            map.put(a, map.getOrDefault(a, 0) + 1);
        }
        int l = 1, r = n-1;
        while(l < r) {
            int mid = (l + r)/2;
            if(check(mid)) {
                l = mid;
            }else {
                r = mid- 1;
            }
//             System.out.println(l + " " + r);
        }
        int ret = 0;
        if(check(l)) ret = l;
        System.out.println(ret);
    }
    public static boolean check(int mid) {
        int g = 0;
        for(int x : map.values()) {
            g += x / mid + (x % mid == 0 ? 0 : 1);
        }
        return g >= m;
    }
}


